-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[code-gen] Support code-gen for opmaker of sparse op #46993
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
if (op_type.compare(0, 7, "sparse_") == 0 && op_type != "sparse_momentum" && | ||
op_type != "sparse_attention") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[TODO] 这里Sparse类算子的过滤条件用硬编码的方式不够鲁棒,如果中间态代码短期内无法去掉,这里的逻辑需要再优化下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) * support generating code of opmaker for backward op invoke forward op * gsupport code-gen of opmaker for sparse op * refind logic of choose phi kernrel * fix complie budg * fix code_gen bug * fix bug * fix kernel signature code-gen * fix complie bug of VarType * fix complie bug of VarType * fix test_sparse_conv_op * fix test_sparse_norm_op
…6993) (#47417) * support generating code of opmaker for backward op invoke forward op (#46912) * [code-gen] Support code-gen for opmaker of sparse op (#46993) * support generating code of opmaker for backward op invoke forward op * gsupport code-gen of opmaker for sparse op * refind logic of choose phi kernrel * fix complie budg * fix code_gen bug * fix bug * fix kernel signature code-gen * fix complie bug of VarType * fix complie bug of VarType * fix test_sparse_conv_op * fix test_sparse_norm_op * [Phi] Refactor logic of judging whether having a phi kernrel (#46920) * refind logic of choose phi kernrel * fix complie budg * update cmake
PR types
Others
PR changes
Others
Describe
支持通过Yaml配置生成Sparse类算子OpMaker以及相关静态图代码。
生成的代码包括
paddle/fluid/operators/generated_sparse_op.cc
中的算子定义和注册相关代码以及paddle/phi/ops/compat/generated_sparse_sig.cc
中的kernel函数签名映射代码。以
sparse_abs
算子为例,paddle/fluid/operators/generated_sparse_op.cc
中生成的代码如下:paddle/phi/ops/compat/generated_sparse_sig.cc
中生成的代码如下: